package wonder.com.basketballdemo;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.View;
import android.widget.RelativeLayout;

import com.sam.ui.base.activity.BaseFragmentActivity;
import com.sam.widget.button.StateBitmapImageButton;
import com.sam.widget.nav_bar.NavigationBar;
import com.sam.widget.nav_bar.NavigationBar.NavigationItemEntity;

import fragment.DiscoveryFragment;
import fragment.MeFragment;
import fragment.MessageFragment;
import fragment.WonderFragment;

/**
 * Created by Administrator on 2016/7/19.
 */
public class SamBaseFragmentAcitvity extends BaseFragmentActivity {

    @Override
    protected void initPageInfo() {
        View limit=new View(this);
        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, 10);
        limit.setBackgroundResource(R.color.limit_color);
        layoutParams.addRule(RelativeLayout.ALIGN_TOP,R.id.haha);
       layoutParams.topMargin=20;
        limit.setLayoutParams(layoutParams);
        getLayoutView().addView(limit);


        StateBitmapImageButton ball = new StateBitmapImageButton(this);
        ball.setId(R.id.haha);
        ball.setImageResource(R.mipmap.icon_center_basketball_normal);
        RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
        lp.addRule(RelativeLayout.CENTER_HORIZONTAL);
        lp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
        lp.bottomMargin = 8;
        ball.setLayoutParams(lp);
        ball.setBackgroundColor(Color.TRANSPARENT);
        getLayoutView().addView(ball);
        ball.setPadding(0, 8, 0, 8);


        NavigationBar.NavigationItemEntity[] items = {new NavigationBar.NavigationItemEntity(SamBaseFragmentAcitvity.this, R.string.wonder, R.mipmap.icon_share_normal, R.mipmap.icon_share_pressed),
                new NavigationBar.NavigationItemEntity(SamBaseFragmentAcitvity.this, R.string.discovery, R.mipmap.icon_discovery_normal, R.mipmap.icon_discovery_pressed),
                new NavigationBar.NavigationItemEntity("", null, null),
                new NavigationBar.NavigationItemEntity(SamBaseFragmentAcitvity.this, R.string.massage, R.mipmap.icon_message_normal, R.mipmap.icon_message_pressed),
                new NavigationBar.NavigationItemEntity(SamBaseFragmentAcitvity.this, R.string.me, R.mipmap.icon_me_normal, R.mipmap.icon_me_pressed),
        };
        Fragment fragment[] = {WonderFragment.getInstanse(), DiscoveryFragment.getInstanse(), null,MessageFragment.getInstanse(), MeFragment.getInstanse()};
        setPageInfo(items, fragment, 0);
        getNavigationBar().setBackgroundResource(R.color.background);
        getNavigationBar().setPadding(0, 8, 0, 8);
        getNavigationBar().setNavItemNamePxSize(30);
        getNavigationBar().setNavItemNameCheckedColor(getResources().getColor(R.color.oginge));
        getNavigationBar().setNavItemNameUncheckedColor(getResources().getColor(R.color.gray));
        getNavigationBar().setNavItemNameIconPadding(10);
    }
}
